console.log("Start"); // 1

debugger

setTimeout(() => {
  app.innerHTML='<div>我丧茶扥扥33333</div>'
  console.log("Timeout 1");
  // alert("在执行宏任务1");
  debugger

  Promise.resolve().then(() => {
    console.log("Promise 1.1");
  });

  Promise.resolve().then(() => {
    console.log("Promise 1.2");
  });

  setTimeout(() => {
    console.log("Timeout 1-1");
  }, 0);
}, 0);

Promise.resolve().then(() => {
  console.log("Promise 0"); // 3
  // alert("在执行微任务");
  debugger
});

setTimeout(() => {
  console.log("Timeout 2");
  // alert("在执行宏任务2");
  debugger

  Promise.resolve().then(() => {
    console.log("Promise 2.1");
  });

  setTimeout(() => {
    console.log("Timeout 2-1");

    Promise.resolve().then(() => {
      console.log("Promise 2-1.2");
    });
  }, 0);
}, 0);

setTimeout(() => {
  console.log("Timeout 3");
  alert("在执行宏任务3");

}, 0);

console.log("End"); // 2

const app = document.getElementById("app");

// app.innerHTML = `<div> 我是一个 div</div>`;
var p = document.createElement("p");
p.className = 'abc'
var d = document.createElement('span')
d.innerText='我是一个span'
p.style = "background:red"
p.appendChild(d)
app.appendChild(p);

// console.log(document.getElementsByClassName('abc'), 123456)

debugger
console.log(app.children.length); // 1